package com.hertz.alarm.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hertz.alarm.entity.IrisVersion;
import com.hertz.alarm.service.EntityService;
import com.hertz.alarm.service.VersionService;
@Service
public class VersionServiceImpl extends BaseServiceImpl implements VersionService {
	@Resource
	private EntityService entityService;
	
	@Override
	public void save(IrisVersion irisVersion) {
		entityService.save(irisVersion);
	}

	@Override
	public IrisVersion getById(int id) {
		return entityService.getById(id, IrisVersion.class);
	}

	@Override
	public void update(IrisVersion irisVersion) {
		entityService.update(irisVersion);
	}

	@Override
	public IrisVersion getByVersionCode(int id) {
		IrisVersion irisVersion = baseDAO.getUniqueResult(IrisVersion.GET_BY_VERSION_CODE, id);
		return irisVersion;
	}

	@Override
	public List<IrisVersion> getAll() {
		return baseDAO.listAll(IrisVersion.class);
	}
}
